from pydantic import BaseModel, EmailStr, Field


class User(BaseModel):
    id: int
    username: str
    hashed_password: str

    class Config:
        orm_mode = True


class UserCreate(BaseModel):
    username: str = Field(...)
    password: str = Field(...)
    confirmPassword: str = Field(...)
    code: str = Field(...)

class UserProfile(BaseModel):
    avatar: str = None
    theme: str = None


class LoginSchema(BaseModel):
    username: str = Field(...)
    password: str = Field(...)


class ChangePasswordSchema(BaseModel):
    oriPassword: str = Field(...)
    newPassword: str = Field(...)
    confirmPassword: str = Field(...)


class Token(BaseModel):
    access_token: str
    token_type: str
